#ifndef INDEXPAGE_H
#define INDEXPAGE_H

#include <QWidget>
#include <QLabel>
#include <QMouseEvent>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSpacerItem>
#include <QDebug>
#include "blogitem.h"
#include "showres.h"

namespace Ui {
class IndexPage;
}

class IndexPage : public QWidget
{
    Q_OBJECT

public:
    explicit IndexPage(QWidget *parent = nullptr);
    ~IndexPage();
    void addBlogItem(QMap<QString, QString> map);
    void addResItem(QMap<QString, QString> map);
    bool eventFilter(QObject *obj, QEvent *event);	// 添加时间过滤器声明
    QList<BlogItem *> itemList;
    void removeBottom();
private:
    Ui::IndexPage *ui;
    QList<QLabel *> labelList;
    QList<QString> strList;
    QVBoxLayout *vLayout, *innerLay;
    QHBoxLayout *hLayout;
    QSpacerItem *spacer;
    QVBoxLayout *blogLayout;
    QSpacerItem *spacer1;
public slots:
    void slotBlogInfo(QMap<QString, QString>, int);
    void slotDownloadRes(QMap<QString, QString>);
    void slotUserRes(QString);
signals:
    void labelClicked(QString type);
    void signalBlogInfo(QMap<QString, QString>, int);
    void signalDownloadRes(QMap<QString, QString>);
    void signalUserRes(QString);
};

#endif // INDEXPAGE_H
